/**产品库存管理-产品库-自购商品API**/
import obj from '@/utils/request'
let {request,baseURL} = obj

//分页查询自购商品
export function getSelfbuygoods(params) {
  return request({
    url: '/selfGoods',
    method: 'get',
    params
  })
}
//查询单个自购商品
export function getSelfbuygoodsById(id) {
  return request({
    url: '/selfGoods/'+id,
    method: 'get',
  })
}
//添加自购商品
export function addSelfbuygoods(data) {
  return request({
    url: '/selfGoods',
    method: 'post',
    data:data
  })
}
//修改自购商品
export function modSelfbuygoods(data) {
  return request({
    url: '/selfGoods',
    method: 'put',
    data:data
  })
}
//删除自购商品
export function delSelfbuygoods(ids) {
  return request({
    url: '/selfGoods',
    method: 'delete',
    data:ids
  })
}

//禁用启用自购商品
export function disableOrEnableSelfbuygoods(stores,params) {
  return request({
    url: '/selfGoods/disableOrEnable',
    method: 'put',
    data:stores,
    params
  })
}

//下载模板文件
export function getSelfGoodsTemplate() {
  return baseURL+'/selfGoods/template'
}

//选择文件
export function selfGoodsOperation(data) {
  return request({
    url: '/selfGoods/multi/operation',
    method: 'post',
    headers: { 'No-Request-Loading': true },
    data
  })
}
